import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Article } from "./article.entity";
@Entity({ name: 'article_tags' })
export class ArticleTag {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    @Index('fulltext_idx', { fulltext: true })
    name: string;

    @ManyToOne(type => Article, article => article.tags, {
        cascade: true
    })
    @JoinColumn()
    article: Article
}